

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class CommissionTest {
	private int lock,stock,barrel;
	private String commission;

	@Before
	public void setUp() throws Exception {
	}
	
	public CommissionTest(int lock, int stock, int barrel, String commission) {
		this.lock = lock;
		this.stock = stock;
		this.barrel = barrel;
		this.commission = commission;
	}

	@Parameters
	public static Collection<Object[]> getData() {
		return Arrays.asList(
				new Object[][] { 
					{ -1, 0, 0, "输入不合法" },
					{ 71, 80, 90, "超出预售范围" },
					{ 0, 0, 0, "0.00" }, 
					{ 1, 0, 0, "4.50" },
					{ 70, 80, 90, "1420.00" },
										
		});
	}

	@Test
	public void testClassify() {
		assertEquals(this.commission, Commission.classify(lock, stock, barrel));
	}


}
